﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableEventValidation="false" CodeBehind="InterestRate.aspx.cs" Inherits="Mortgage.Form.InterestRate" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <title>Thiết lập lãi suất</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="filter">
        Cửa tiệm:
        <asp:DropDownList ID="drpFilterAgent" runat="server" DataTextField="Name" Width="200px"
            DataValueField="ID" AppendDataBoundItems="true">
            <asp:ListItem Text="All" Value="-1" />
        </asp:DropDownList>
        &nbsp; Lãi suất:
        <asp:DropDownList ID="drpConfigType" runat="server" DataTextField="Value" Width="200px"
            DataValueField="ID" AppendDataBoundItems="true">
            <asp:ListItem Text="All" Value="-1" />
        </asp:DropDownList>
        &nbsp;Ngày<asp:TextBox ID="fldFilterDate" runat="server" CssClass="dtePicker" />
        &nbsp;<asp:Button ID="btnFilter" runat="server" Text="Filter(Lọc)" OnClick="btnFilter_Click" />
    </div>
    <div class="grid">
        <center>
            <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" BackColor="White"
                BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" DataKeyNames="ID"
                CellPadding="3" OnSelectedIndexChanged="grid_SelectedIndexChanged" EnableModelValidation="True">
                <EmptyDataTemplate>
                    <div class="noData">
                        Chưa có dữ liệu lãi suất!</div>
                </EmptyDataTemplate>
                <Columns>
                    <asp:CommandField ShowSelectButton="True" SelectImageUrl="~/Images/icon/select.gif"
                        ButtonType="Image" />
                    <asp:BoundField DataField="AgentName" HeaderText="Tên cửa tiêm" ItemStyle-Width="200px"
                        ReadOnly="True" SortExpression="AgentName">
                        <ItemStyle Width="200px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="Value" HeaderText="Lọai lãi số" ItemStyle-Width="200px"
                        ReadOnly="True" SortExpression="Value">
                        <ItemStyle Width="200px"></ItemStyle>
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Ngày bắt đầu" SortExpression="BeginDate">
                        <ItemTemplate>
                            <asp:Label ID="lblBeginDate" runat="server" Text='<%#   Eval("BeginDate","{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="150px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="EndDate" HeaderText="Ngày kết thúc" ItemStyle-Width="150px"
                        ReadOnly="True" SortExpression="EndDate" DataFormatString="{0:d}">
                        <ItemStyle Width="150px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="InterestRate" HeaderText="Lãi suất %" ItemStyle-Width="80px">
                        <ItemStyle Width="150px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="NumOfDayExpire" HeaderText="Số ngày hết hạn chuộc" ItemStyle-Width="80px">
                        <ItemStyle Width="200px"></ItemStyle>
                    </asp:BoundField>
                </Columns>
                <FooterStyle BackColor="White" ForeColor="#000066" />
                <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
                <RowStyle ForeColor="#000066" />
                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
        </center>
    </div>
    <div class="detail">
        <div class="header">
            Thông tin lãi suất
        </div>
        <asp:Label ID="DialogMess" runat="server" CssClass="failureNotification" />
        <asp:HiddenField ID="fldID" runat="server" />
        <table>
            <tr>
                <td class="label">
                    Loại lãi suất:
                </td>
                <td>
                    <asp:DropDownList ID="fldName" runat="server" DataTextField="Value" Width="200px"
                        DataValueField="ID">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="reqfldName" runat="server" ErrorMessage="*" ValidationGroup="detail"
                        CssClass="failureNotification" ControlToValidate="fldName" />
                </td>
                <%-- <td colspan="2">&nbsp;</td>--%>
            </tr>
            <tr>
                <td class="label">
                    Lãi suất %:<span class="required">*</span>
                </td>
                <td>
                    <asp:TextBox ID="fldInterestRate" runat="server" MaxLength="200" Width="300px" />
                    <asp:RangeValidator ID="reqfldAddress" runat="server" ErrorMessage="*" ValidationGroup="detail"
                        Type="Integer" MinimumValue="1" MaximumValue="999" CssClass="failureNotification"
                        ControlToValidate="fldInterestRate" />
                </td>
                <%-- <td colspan="2">&nbsp;</td>--%>
            </tr>
            <tr>
                <td class="label">
                    Số ngày hết hạn chuộc:<span class="required">*</span>
                </td>
                <td>
                    <asp:TextBox ID="fldNumOfDayExpire" runat="server" MaxLength="50" />
                     <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="*" ValidationGroup="detail"
                        Type="Integer" MinimumValue="1" MaximumValue="999" CssClass="failureNotification"
                        ControlToValidate="fldNumOfDayExpire" />

                   
                </td>
                <%-- <td colspan="2">&nbsp;</td>--%>
            </tr>
            <tr>
                <td class="label">
                    Ngày bắt đầu:<span class="required">*</span>
                </td>
                <td>
                    <asp:TextBox ID="fldStartDate" runat="server" CssClass="dtePicker" />
                    <asp:RequiredFieldValidator ID="reqfldStartDate" runat="server" ValidationGroup="detail"
                        ErrorMessage="*" CssClass="failureNotification" ControlToValidate="fldStartDate" />
                </td>
                <td class="label">
                    Ngày kết thúc:
                </td>
                <td>
                    <asp:TextBox ID="fldEndDate" runat="server" Enabled="false" />
                </td>
            </tr>
            <tr>
                <td class="label">
                    Ghi chú:
                </td>
                <td colspan="3">
                    <asp:TextBox ID="fldDescription" runat="server" TextMode="MultiLine" Width="476px" />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="btnDelete" runat="server" Text="Xóa" CssClass="btnDelete" CausesValidation="false"
                        OnClick="btnDelete_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnNew" runat="server" Text="Tạo mới" CssClass="btnNew" CausesValidation="false"
                        OnClick="btnNew_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnSave" runat="server" Text="Lưu" CssClass="btnSave" ValidationGroup="detail"
                        OnClick="btnSave_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnCancel" runat="server" Text="Huy" CssClass="btnCancel" CausesValidation="false"
                        OnClick="btnCancel_Click" />
                    <ajaxtoolkit:ConfirmButtonExtender ID="cfmDelete" runat="server" ConfirmText="Bạn có thực sự muốn xóa dữ liệu này?"
                        TargetControlID="btnDelete" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
